package com.webc.framework.listener;

import com.webc.framework.start.AppServer;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * 监听tomcat的启动
 * @author hejianglong
 * @date 2018/9/7.
 */
@WebListener
public class TomcatListener implements ServletContextListener {

    /**
     * 启动的时候去做IOC, AOP初始化
     * 及检查规范
     * @param servletContextEvent
     */
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        AppServer.init();
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        System.out.println("destroy server ------");
    }
}
